home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 November: Tool Chest / Dev.CD Nov 00 TC Disk 2.toast / pc / sample code / overview / dtscpluslibrary / headers / appleevent.h next >
Encoding:
Text File  |  2000-09-28  |  3.2 KB  |  95 lines

  1. /*
  2.     File:        AppleEvent.h
  3.  
  4.     Contains:    TAppleEvent is an Apple Event class that will send and receive Apple Events.
  5.                   AppleEvent.cp contains the TAppleEvent class definition.
  6.  
  7.     Written by: Kent Sandvik    
  8.  
  9.     Copyright:    Copyright © 1992-1999 by Apple Computer, Inc., All Rights Reserved.
  10.  
  11.                 You may incorporate this Apple sample source code into your program(s) without
  12.                 restriction. This Apple sample source code has been provided "AS IS" and the
  13.                 responsibility for its operation is yours. You are not permitted to redistribute
  14.                 this Apple sample source code as "Apple sample source code" after having made
  15.                 changes. If you're going to re-distribute the source, we require that you make
  16.                 it clear in the source that the code was descended from Apple sample source
  17.                 code, but that you've made changes.
  18.  
  19.     Change History (most recent first):
  20.                 8/18/1999    Karl Groethe    Updated for Metrowerks Codewarror Pro 2.1
  21.                 
  22.  
  23. */
  24. // Declare label for this header file
  25. #ifndef _APPLEEVENT_
  26. #define _APPLEEVENT_
  27.  
  28. #ifndef _DTSCPLUSLIBRARY_
  29. #include "DTSCPlusLibrary.h"
  30. #endif
  31.  
  32. //    Toolbox Include Files
  33. #ifndef __PROCESSES__
  34. #include <Processes.h>
  35. #endif
  36.  
  37. #ifndef __APPLEEVENTS__
  38. #include <AppleEvents.h>
  39. #endif
  40.  
  41.  
  42. // _________________________________________________________________________________________________________ //
  43. //    TAppleEvent Class Interface
  44. class TAppleEvent
  45. // The TAppleEvent class will provide Apple Event services (send, receive, get and put
  46. // descriptor information.
  47. {
  48. public:
  49.     // CONSTRUCTORS AND DESTRUCTORS
  50.     TAppleEvent();                                // create a kCurrentProcess AE
  51.     TAppleEvent(OSType signature);                // create an AE based on the OSType address
  52.     ~TAppleEvent();                                // default destructor
  53.  
  54.     void Initialize();                            // initialize fields to known values
  55.  
  56.     //    MAIN INTERFACES
  57.     virtual OSErr Define(AEEventClass theClass,
  58.                          AEEventID ID);            // create the actual AE
  59.     virtual OSErr Send();                        // fire off the Apple Event
  60.     virtual OSErr Send(AEEventClass theClass,
  61.                        AEEventID ID);            // fire off with the specs
  62.     virtual void SetAddress(const AEAddressDesc address);// set address for our AE
  63.  
  64.     //    GET/SET MEMBER FUNCTIONS
  65.     virtual long GetTimeoutValue() const;        // get our timeout value
  66.     virtual void SetTimeoutValue(const long val);// set out timeout value
  67.     virtual AESendMode GetSendingMode() const;    // get our sending mode
  68.     virtual void SetSendingMode(const AESendMode mode);// set our sending mode    
  69.     virtual AESendPriority GetPriority() const;    // get our priority setting
  70.     virtual void SetPriority(const AESendPriority value);// set our priority setting        
  71.  
  72.     //    FIELDS
  73. protected:
  74.     OSErr fError;                                // current error 
  75.     OSType fSignature;                            // keep track of the OSType used
  76.     AEAddressDesc fTarget;                        // needed data structure for AEs
  77.     AppleEvent fAE;                                // the final Apple Event itself
  78.     AppleEvent fReply;                            // the reply AE
  79.     AESendPriority fPriority;                    // priority mode
  80.     AESendMode fSendMode;                        // our send mode field
  81.     long fTimeout;                                // timeout (in ticks)
  82. };
  83.  
  84. #endif
  85.  
  86. // _________________________________________________________________________________________________________ //
  87.  
  88.  
  89. /*    Change History (most recent last):
  90.   No        Init.    Date        Comment
  91.   1            khs        11/22/92    New file
  92.   2            khs        1/7/93        Cleanup
  93. */
  94.  
  95.